/**
 * Created by Administrator on 2015/9/8.
 */
var mysql = require('mysql');
var $conf = require('../../conf/db');
var $util = require('../utils/util');
var $sql = require('../mapping/adminSuperMapping');

var pool = mysql.createPool($util.extend({}, $conf.mysql));


module.exports = {

    changeAdmitStatus:function(req,status,invitedId,callback){
        $util.queryHelper(req,$sql.changeAdmitStatus, [status,invitedId],  pool,function (result) {
            callback(result);
        })
    },
    queryAllAdmit:function(req,param,callback){
        $util.queryHelper(req,$sql.queryAllAdmit, '%'+param+'%',  pool,function (result,err) {
            callback(result,param);
        })
    },
    queryInvite:function(req,res,callback){
        $util.queryHelper(req,$sql.queryInvite, [req.param('id')],  pool,function (result,err) {
                callback(result);
        })
    },
};